package com.smart.primary.sys.service.impl;

import com.smart.primary.sys.dao.ConfigMapper;
import com.smart.primary.sys.service.ConfigService;
import com.smart.primary.sys.vo.Config;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

@Service
public class ConfigServiceImpl implements ConfigService {

    @Resource
    private ConfigMapper configDao;

    public ConfigServiceImpl() {
    }

    public List<Config> getConfigList() {
        return this.configDao.getConfigList();
    }

    public Map<String, String> getSysConfigToMap() {
        List<Config> allList = this.getConfigList();
        Map<String, String> map = new HashMap();
        Iterator var3 = allList.iterator();

        while(var3.hasNext()) {
            Config config = (Config)var3.next();
            map.put(config.getJkey(), config.getJvalue());
        }

        return map;
    }

    public String getValue(String key) {
        return this.configDao.getValue(key);
    }

    public void update(Map<String, String> params, HttpServletRequest request) {
        Iterator var3 = params.entrySet().iterator();

        while(var3.hasNext()) {
            Map.Entry entry = (Map.Entry)var3.next();
            this.configDao.update((String)entry.getKey(), (String)entry.getValue());
        }

    }

    public String getMysqlVsesion() {
        return this.configDao.getMysqlVsesion();
    }

    @Override
    public Config queryObject(Config entity) throws Exception {
        return null;
    }

    @Override
    public List<Config> queryList(Config entity) throws Exception {
        return null;
    }

    @Override
    public List<Config> queryListByPage(Config entity) throws Exception {
        return null;
    }

    @Override
    public Integer queryCount(Config entity) throws Exception {
        return null;
    }

    @Override
    public Integer insert(Config entity) throws Exception {
        return null;
    }

    @Override
    public Integer update(Config entity) throws Exception {
        return null;
    }

    @Override
    public Integer delete(String id) throws Exception {
        return null;
    }
}